import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;


Vue.use(VueRouter)
Vue.use(ElementUI);

const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView,
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   component: () => import( '../views/AboutView.vue')
  // },
  {
    path: '/',
    name: 'home',
    component: ()=>import('../views/Logo.vue'),
  },
  // 图标
  {
    path:'/logo',
    name:'logo',
    component:()=>import('../views/Logo.vue')
  },
  // 省份跳转
  {
    path:'/province',
    name:'province',
    component:()=>import('../views/Province.vue')
  },
  // 关于我们
  {
    path: '/aboutus',
    name: 'aboutus',
    component: () => import('../views/AboutUs.vue')
  },
  // 会员卡
  {
    path: '/vip',
    name: 'vip',
    component: () => import('../views/Vip.vue'),
    // children:[
    //   {
    //     path: 'apply',
    //     name: 'apply',
    //     component: () => import('../views/Apply.vue')
    //   },
    //   {
    //     path: 'continue',
    //     name: 'continue',
    //     component: () => import('../views/Continue.vue')
    //   },
    //   {
    //     path: 'discount',
    //     name: 'discount',
    //     component: () => import('../views/Discount.vue')
    //   },
    // ]
  },
  // 申请会员卡
  {
    path: '/apply',
    name: 'apply',
    component: () => import('../views/Apply.vue')
  },
  // 续卡
  {
    path: '/continue',
    name: 'continue',
    component: () => import('../views/Continue.vue')
  },
  // 申请会员卡
  {
    path: '/immediately',
    name: 'immediately',
    component: () => import('../views/Immediately.vue')
  },
  {
    path: '/immediately2',
    name: 'immediately2',
    component: () => import('../views/Immediately2.vue')
  },
  // 打折
  {
    path: '/discount',
    name: 'discount',
    component: () => import('../views/Discount.vue')
  },
  // 最新资讯
  {
    path: '/web-info-lists',
    name: 'web-info-lists',
    component: ()=>import('../views/News.vue'),
    redirect: '/web-info-lists/jchd',
    children:[
      // 精彩活动
      {
        path: 'jchd',
        name: 'jchd',
        component: ()=>import('../views/zxzx/Jchd.vue')
      },
      // 加盟信息
      {
        path: 'jmxx',
        name: 'jmxx',
        component: ()=>import('../views/zxzx/Jmxx.vue')
      },
      // 旅舍动态
      {
        path: 'lsdt',
        name: 'lsdt',
        component: ()=>import('../views/zxzx/Lsdt.vue')
      },
      // 视频
      {
        path: 'video',
        name: 'video',
        component: ()=>import('../views/zxzx/Video.vue')
      },
      // 总部动态
      {
        path: 'zbdt',
        name: 'zbdt',
        component: ()=>import('../views/zxzx/Zbdt.vue')
      },
    ]
  },
  // 旅舍预定
  {
    path:'/yuding',
    name:'yuding',
    component:()=>import('../views/Yuding.vue')
  },
  // 旅舍总览
  {
    path:'/pandect',
    name:'pandect',
    component:()=>import('../views/Pandect.vue')
  },
  // 旅舍总览详情
  {
    path:'/pandectdetail',
    name:'pandectdetail',
    component:()=>import('../views/PandectDetail.vue')
  },
  // 旅舍加盟
  {
    path:'/join',
    name:'join',
    component:()=>import('../views/Join.vue')
  },
  {
    path: '/socialwelfare',
    name: 'socialwelfare',
    component: () => import('../views/SocialWelfare.vue'),
  },
    // 舍会企业/公益项目
    {
      path: '/socialwelfare',
      name: 'socialwelfare',
      component: () => import('../views/SocialWelfare.vue'),
    },
    // 公益图书馆
    {
      path: '/publicwelfarelibrary',
      name: 'publicwelfarelibrary',
      component: () => import('../views/PublicWelfareLibrary.vue'),
    },
    // 旅舍公益
    {
      path: '/publicwelfare',
      name: 'publicwelfare',
      component: () => import('../views/PublicWelfare.vue'),
    },
    // 联系总部
    {
      path: '/contact',
      name: 'contact',
      component: () => import('../views/Contact.vue'),
    },
    // 登录
  {
    path:'/register',
    name:'register',
    component:()=>import('../views/Register.vue')
  },
  // 注册
  {
    path:'/login',
    name:'login',
    component:()=>import('../views/Login.vue')
  },
  // 订单管理
  {
    path:'/order',
    name:'order',
    component:()=>import('../views/Order.vue')
  },
 
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
